﻿using System.Windows.Forms;

namespace BackupRestoreSoftwares
{
    public class EasyDialog
    {
        /// <summary>
        ///     Hiện msg box (yes/no)
        /// </summary>
        /// <param name="caption">Nội dung cần thông báo</param>
        /// <returns>DialogResult</returns>
        public static DialogResult ShowYesNoDialog(string caption, string title)
        {
            return MessageBox.Show(caption, title, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }

        /// <summary>
        ///     Hiện msg box thông báo thao tác thành công
        /// </summary>
        /// <param name="action">Lưu/Xóa/Sửa/...</param>
        /// <returns>DialogResult</returns>
        public static DialogResult ShowSuccessfulDialog(string action, string title)
        {
            return MessageBox.Show(action, title, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        /// <summary>
        ///     Hiện msg box thông báo thao tác không thành công
        /// </summary>
        /// <param name="action">Lưu/Xóa/Sửa/...</param>
        /// <returns>DialogResult</returns>
        public static DialogResult ShowUnsuccessfulDialog(string action, string title)
        {
            return MessageBox.Show(action, title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }

        /// <summary>
        ///     Hiện msg box thông báo lỗi
        /// </summary>
        /// <param name="caption"></param>
        /// <returns></returns>
        public static DialogResult ShowErrorDialog(string caption, string title)
        {
            return MessageBox.Show(caption, title, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        /// <summary>
        ///     Hiện msg box cảnh báo
        /// </summary>
        /// <param name="caption"></param>
        /// <returns></returns>
        public static DialogResult ShowWarningDialog(string caption, string title)
        {
            return MessageBox.Show(caption, title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }

        public static DialogResult ShowInfoDialog(string caption, string title)
        {
            return MessageBox.Show(caption, title, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public static DialogResult ShowYesNoCancelDialog(string caption, string title)
        {
            return MessageBox.Show(caption, title, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
        }

        // Show yes no dialog backup 
        public static DialogResult ShowYesNoBackup(string caption)
        {
            return MessageBox.Show("Are you sure backup '" + caption + "'", "Backup Dialog",
                MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
        }

        // Show yes no dialog restore
        public static DialogResult ShowYesNoRestore(string caption)
        {
            return MessageBox.Show("Are you sure restore '" + caption + "'", "Restore Dialog",
                MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
        }

        // Show success Backup
        public static DialogResult ShowSuccessBackup(string action)
        {
            return MessageBox.Show("Backup '" + action + "' Successfull!", "Successfull Backup", MessageBoxButtons.OK,
                MessageBoxIcon.Information);
        }

        // Show success Restore
        public static DialogResult ShowSuccessRestore(string action)
        {
            return MessageBox.Show("Restore '" + action + "' Successfull!", "Successfull Restore", MessageBoxButtons.OK,
                MessageBoxIcon.Information);
        }

        // Show Not install
        public static DialogResult ShowNotinstall(string caption)
        {
            return MessageBox.Show(caption + " doesn't install!", "Program not installed!", MessageBoxButtons.OK,
                MessageBoxIcon.Error);
        }

        // Show contact admin
        public static DialogResult ShowContact()
        {
            return MessageBox.Show("Please contact: caiwindao@outlook.com", "Error!", MessageBoxButtons.OK,
                MessageBoxIcon.Error);
        }
    }
}